package com.cmall.common.foundation.constant;

import java.io.File;

/**
 * 全局常量类
 */
public class GlobalConstant {

	/**
	 * 店铺key文件路径,D:\nginx-1.0.15\nginx-1.0.15\html
	 */
	// public static final String FILE_PATH_SHOPKEY = "D:" + File.separator
	// + "nginx-1.0.15" + File.separator + "nginx-1.0.15" + File.separator
	// + "html" + File.separator;
	public static final String FILE_PATH_SHOPKEY = File.separator + "home" + File.separator + "admin" + File.separator
			+ "mqweb" + File.separator + "html" + File.separator;

	/** 过期时间80秒,用于抢单模块计算消息是否过期 */
	public static final long TIME_TO_LIVE = 80000;
	/** redis用于抢单业务 (定时清除过期数据) */
	@Deprecated
	public static final String CASHDESK_SORTED_GRAB = "cashdesk.sorted.grab";
	/** redis用于保存client端销售、支付流水(原流水逻辑) */
	@Deprecated
	public static final String CASHDESK_LIST_UPLOAD = "cashdesk.list.upload";
	/** redis用于保存client端订单信息(包含销售、支付流水) */
	public static final String CLIENT_LIST_UPLOAD = "flow.list.upload";
	/** redis用于处理订单信息(包含销售、支付流水)备份 */
	public static final String CLIENT_HASH_UPLOAD = "flow.hash.upload";
	/** redis用于处理订单信息(包含销售、支付流水)去重 (定时清除过期数据) */
	@Deprecated
	public static final String CLIENT_HASH_KEY = "flow.hash.key";
	public static final String CASHDESK_ZSET_ORDERFLOWKEY = "cashdesk.zset.OrderFlowKey";
	/** redis用于保存client端操作的log */
	public static final String UPLOAG_HASH_OPERLOG = "uploadFlow.hash.OperLog";
	/** redis hash key mysql上传mongo同步支付流水,查询mysql的查询条件 */
	public static final String UPLOAG_HASH_QUERYPAYFLOW = "upload.hash.QueryPayFlow";
	/** redis hash key mysql上传mongo同步销售流水,查询mysql的查询条件 */
	public static final String UPLOAG_HASH_QUERYSALEFLOW = "upload.hash.QuerySALEFlow";
	/** redis日结销售统计，提供给快捷订货使用 */
	public static final String CASHDESK_LIST_ITEMDAYSALE = "cashdesk.list.ItemDaySale";
	/** redis用于缓存门店信息 */
	public static final String CASHDESK_HASH_BRANCHINFO = "cashdesk.hash.BranchInfo";
	/** redis用于缓存档案商品 (itemNo) */
	public static final String CASHDESK_HASH_PRODUCT = "cashdesk.hash.Product";
	/** redis用于缓存档案商品 (itemNo-itemSubno) */
	public static final String CASHDESK_HASH_ITEM = "cashdesk.hash.Item";
	/** redis用于缓存盘点uuid，去重 */
	public static final String SHEET_HASH_PDUPLOAD = "sheet.hash.PdUpload";
	public static final String SHEET_HASH_FIELD = "sheet.";
	/** redis库存操作时用于避免每次请求重复执行(三种数据库各自维护,定时清除过期数据) */
	public static final String CASHDESK_ZSET_SQLSERVERSTOCKCHECK = "cashdesk.zset.SqlServerStockCheck";
	public static final String CASHDESK_ZSET_MYSQLSTOCKCHECK = "cashdesk.zset.MysqlStockCheck";
	public static final String CASHDESK_ZSET_MONGODBTOCKCHECK = "cashdesk.zset.MongoDBStockCheck";

	/**用于缓存数据字典**/
	public static final String CASHDESK_HASH_DICTIONARY = "cashdesk.hash.Dictionary";


	// ===========订单、库存、小计相关缓存-开始===========
	// 处理销售、支付流程流程依赖的缓存
	/** 所有pos client端上传订单（销售、支付流水）均添加到此队列待处理，保存内容为String类型 */
	public static final String CASHDESK_LIST_ORDERFLOW = "cashdesk.list.OrderFlow";
	/**
	 * 当处理订单数据之前，先将数据保存到Hash中，避免业务流程中异常时数据丢失（异常时由补偿机制处理）
	 * 
	 * <pre>
	 * 存储格式：[key,fieid,value]
	 * key = 缓存名
	 * fieid = onlyID&timestamp字符串
	 * value = 订单json字符串
	 * </pre>
	 */
	public static final String CASHDESK_HASH_ORDERFLOW = "cashdesk.hash.OrderFlow";
	/**
	 * 通过排序集合实现订单去重机制
	 * 
	 * <pre>
	 * 存储格式：[key,score,member]
	 * key = 缓存名
	 * score = timestamp
	 * member = onlyID字符串
	 * </pre>
	 */
	public static final String CASHDESK_ZSET_ORDERFLOW = "cashdesk.zset.OrderFlow";

	// 处理商品库存流程依赖的缓存(mysql档案库)
	/**
	 * 所有库存操作（销售、采购、采购退货、盘点、报损、报溢）均添加到此队列待处理，保存内容为byte[]类型，使用
	 * {@link com.cmall.common.redis.serializer.JDKSerializer}序列化
	 */
	public static final String CASHDESK_LIST_STOCKFLOW = "cashdesk.list.StockFlow";
	/**
	 * 当处理库存数据之前，先将数据保存到Hash中，避免业务流程中异常时数据丢失（异常时由补偿机制处理）
	 * 
	 * <pre>
	 * 存储格式：[key,fieid,value]
	 * key = 缓存名
	 * fieid = flowno&flowid&timestamp(byte[]类型)
	 * value = 库存流水StockFlow(byte[]类型),使用{@link com.cmall.common.redis.serializer.JDKSerializer}序列化
	 * </pre>
	 * 
	 */
	public static final String CASHDESK_HASH_STOCKFLOW = "cashdesk.hash.StockFlow";
	/**
	 * 通过排序集合实现库存去重机制 ，score为long类型，member字符串类型
	 * 
	 * <pre>
	 * 存储格式：[key,score,member]
	 * key = 缓存名
	 * score = timestamp
	 * member = flowno&flowid字符串
	 * </pre>
	 */
	public static final String CASHDESK_ZSET_STOCKFLOW = "cashdesk.zset.StockFlow";

	// 处理商品库存流程依赖的缓存(mongo下发库)
	/**
	 * 所有库存操作（销售、采购、采购退货、盘点、报损、报溢）均添加到此队列待处理，保存内容为byte[]类型，使用
	 * {@link com.cmall.common.redis.serializer.JDKSerializer}序列化
	 */
	public static final String CASHDESK_LIST_STOCKFLOW_MONGO = "cashdesk.list.StockFlow.Mongo";
	/**
	 * 当处理库存数据之前，先将数据保存到Hash中，避免异常时数据丢失（异常时由补偿机制处理）
	 * 
	 * <pre>
	 * 存储格式：[key,fieid,value]
	 * key = 缓存名
	 * fieid = flowno&flowid&timestamp(byte[]类型)
	 * value = 库存操作流水StockOperLog(byte[]类型),使用{@link com.cmall.common.redis.serializer.JDKSerializer}序列化
	 * </pre>
	 */
	public static final String CASHDESK_HASH_STOCKFLOW_MONGO = "cashdesk.hash.StockFlow.Mongo";
	/**
	 * 通过排序集合实现库存去重机制
	 * 
	 * <pre>
	 * 存储格式：[key,score,member]
	 * key = 缓存名
	 * score = timestamp
	 * member = flowno&flowid字符串
	 * </pre>
	 */
	public static final String CASHDESK_ZSET_STOCKFLOW_MONGO = "cashdesk.zset.StockFlow.Mongo";

	// 小计统计流程依赖的缓存
	/**
	 * 缓存支付流水（通过CASHDESK_ZSET_SUBTOTAL_STOCKFLOW内容实现定时删除），fieid、value均字符串类型
	 * 
	 * <pre>
	 * 存储格式：[key,fieid,value]
	 * key = 缓存名
	 * fieid = flowno字符串
	 * value = 支付流水json字符串
	 * </pre>
	 */
	public static final String CASHDESK_HASH_SUBTOTAL_PAYFLOW = "cashdesk.hash.SubTotal.PayFlow";
	/**
	 * 缓存库存流水，byte[]类型，使用{@link com.cmall.common.redis.serializer.JDKSerializer}
	 * 序列化
	 */
	public static final String CASHDESK_LIST_SUBTOTAL_STOCKFLOW = "cashdesk.list.SubTotal.StockFlow";
	/**
	 * 缓存库存流水实现小计流程去重机制
	 * 
	 * <pre>
	 * 存储格式：[key,score,member]
	 * key = 缓存名
	 * score = timestamp
	 * member = flowno&flowid字符串
	 * </pre>
	 */
	public static final String CASHDESK_ZSET_SUBTOTAL_STOCKFLOW = "cashdesk.zset.SubTotal.StockFlow";
	// ===========订单、库存、小计相关缓存-结束===========
	
	/**
	 * 同步基础下发商品流程去重缓存
	 * 
	 * <pre>
	 * 存储格式：[key,score,member]
	 * key = 缓存名
	 * score = timestamp
	 * member = marketId
	 * </pre>
	 */
	public static final String CASHDESK_ZSET_SYNCHBASEGOODS = "cashdesk.zset.SynchBaseGoods";

	/** 供应商默认编号 */
	public static final String DEFAULT_SUPPLY_NO = "0000";
	/** 供应商默认名称 */
	public static final String DEFAULT_SUPPLY_NAME = "中商惠民";

	/** 单位默认编号,默认99 */
	public static final String DEFAULT_ITEM_UNIT_NO = "99";
	/** 单位默认名称 */
	public static final String DEFAULT_ITEM_UNIT_NAME = "默认";

	/** 商品三级类别默认编号,默认99 */
	public static final String DEFAULT_ITEM_CATE_NO = "99";
	/** 商品三级类别默认名称 */
	public static final String DEFAULT_ITEM_CATE_NAME = "默认";

	/** 品牌默认编号,默认9998 */
	public static final String DEFAULT_ITEM_BRAND_NO = "9998";
	/** 品牌默认名称 */
	public static final String DEFAULT_ITEM_BRAND_NAME = "默认";

	/** mysql格式化时间格式保留到年 */
	public static final String DATE_FORMAT_YEAR = "%Y";
	/** mysql格式化时间格式保留到月 */
	public static final String DATE_FORMAT_MONTH = "%Y-%c";
	/** mysql格式化时间格式保留到日 */
	public static final String DATE_FORMAT_DAY = "%Y-%c-%d";

	/** BigDecimal做除法divide保留小数位 */
	public static final int BIGDECIMAL_DIVIDE_SCALE = 6;

	/** 做分页查询时 分页大小 **/
	public static final int PAGE_SIZE = 100;

	/** B2B 分公司详细信息 start */

	/** redis hash key 用于存放B2B分公司的信息 */
	public static final String B2B_BRANCH_INFO = "B2bUpload.hash.BranchInfo";

	/** B2BUploadBranchInfo key */
	public static final String SERVICE_DOMAIN = "{cn.cmall}";

	/** B2BUploadBranchInfo 测试url */
	public static final String URL = "http://127.0.0.1:10010/market/v2/branche";

	/** 加密方式 */
	public static final String encryModel = "MD5";
	public static final int UPLOAD_SIZE = 500;
	/** B2B 分公司详细信息 end */
	/** 对外接口服务HTTP请求信息格式类型 */
	public static final String CONTENT_TYPE_JSON = "application/json";
	/**redis用于缓存惠配通订单*/
	public static final String HPT_LIST_ORDERS = "hpt.list.orders";
	/**redis备份惠配通订单,流程处理完毕后删除*/
	public static final String HPT_LIST_ORDERS_BAK = "hpt.list.orders.bak";
	/** redis hash key 用于存放角色的信息 */
	public static final String CASHDESK_HASH_ROLEINFO = "cashdesk.hash.RoleInfo";
	/** redis hash key 用于存放操作员的信息 */
	public static final String CASHDESK_HASH_USERINFO = "cashdesk.hash.UserInfo";
	/** redis hash key 用于存放门店的信息 */
	public static final String CASHDESK_HASH_MARKETINFO = "cashdesk.hash.marketInfo";
	/** 过期时间7天,用于缓存操作员信息 7天毫秒值*/
	public static final int TIME_TO_USERINFO = 604800000;
	/** 数据字典redis*/
	public static final String CASHDESK_HASH_DICTIONARYS = "mgt.hash.DictionaryNos";

	/**redis缓存库存stockflow 用于同步爱鲜蜂库存信息*/
	public static final String AXF_LIST_STOCK_OPER = "axf.list.stock.oper";
	/**redis缓存库存stockflow 用于同步爱鲜蜂库存信息*/
	public static final String AXF_HASH_STOCK_HANDLED = "axf.hash.stock.handled";
	/**redis缓存TOKEN 用于同步爱鲜蜂库存信息*/
	public static final String AXF_REQUST_TOKEN="axf.string.token";
	/**redis用于缓存爱鲜蜂销售单|采购单|采购退货单|非正常业务*/
	public static final String AXF_LIST_SALEFLOW = "axf.list.saleflow";
	public static final String AXF_LIST_PURCHASE_SHEET = "axf.list.purchasesheet";
	public static final String AXF_LIST_PURCHASE_REFUND_SHEET = "axf.list.refundsheet";
	public static final String AXF_LIST_STOCKFLOW = "axf.list.stockflow";


	public static final String EQUALS_ITEM_SIZE = "equals_item_size";
	public static final String EQUALS_ITEM_SIZE_RESULT = "equals_item_size_result";
	/**
	 * 通过排序集合实现订单去重机制
	 *
	 * <pre>
	 * 存储格式：[key,score,member]
	 * key = 缓存名
	 * score = timestamp
	 * member = correlationDataId;// mq消息的唯一标识
	 * </pre>
	 */
	public static final String CASHDESK_ZSET_AXFMQ = "cashdesk.zset.axfmqid";


}
